#!/bin/bash
function Usage(){
	echo "error: please input two numbers"
	echo $"Usage: sh $0 <num1> <num2>"
	exit 2
}
if [ $# -ne 2 ];then
	Usage
fi
expr $1 + 1  &>/dev/null 2>&1
ResultA=$?
expr $2 + 1  &>/dev/null 2>&1
ResultB=$?

if [ $ResultA -ne 0 -o $ResultB -ne 0 ];then
	Usage
fi

echo "$1+$2=$[$1+$2]"
echo "$1-$2=$[$1-$2]"
echo "$1*$2=$[$1*$2]"
if [ $2 -eq 0 ];then
	echo "error"
else
	echo "$1/$2=$[$1/$2]"
fi
